package com.kadron.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.kadron.base.KBase;

@Entity
@Table(name = "k_user_kadrons")
public class UserKadrons extends KBase implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6872642406545572124L;
	
	private User user;
	private long kadrons;
	private String comment;
	
	public UserKadrons() {
		super();
	}
	
	public UserKadrons(User user, long kadrons, String comment) {
		this();
		this.user = user;
		this.kadrons = kadrons;
		this.comment = comment;
	}

	@ManyToOne
	@JoinColumn(name = "user_id", nullable = false, updatable = false)
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "kadrons", nullable = false)
	public long getKadrons() {
		return kadrons;
	}

	public void setKadrons(long kadrons) {
		this.kadrons = kadrons;
	}

	@Column(name = "comment")
	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UserKadrons other = (UserKadrons) obj;
		if (id != other.id)
			return false;
		return true;
	}

}
